package me.tuyou.jvm;

/**
 * 获取的是分配给jvm的内存情况
 * @author tuyou_cd
 * @date 2020/12/29 11:03
 */
public class JvmMemoryTest {

    public static void main(String[] args) {

        long totalMemory = Runtime.getRuntime().totalMemory();
        long freeMemory = Runtime.getRuntime().freeMemory();

        System.out.println(totalMemory / 1024 / 1024);
        System.out.println(freeMemory / 1024/ 1024);
    }
}
